#[cfg(test)]
mod tests {
    use crate::type_system::string_type::string_methods::StringMethods;
    use crate::type_system::string_type::string_utils::StringUtils;

    #[test]
    fn test_string_methods_creation() {
        let methods = StringMethods::create_all_methods();

        // 检查基本方法是否存在
        assert!(methods.contains_key("长度"));
        assert!(methods.contains_key("是否空"));
        assert!(methods.contains_key("转大写"));
        assert!(methods.contains_key("转小写"));
        assert!(methods.contains_key("包含"));
        assert!(methods.contains_key("分割"));
        assert!(methods.contains_key("替换"));
        assert!(methods.contains_key("截取"));

        // 检查高级方法是否存在
        assert!(methods.contains_key("匹配"));
        assert!(methods.contains_key("查找匹配"));
        assert!(methods.contains_key("替换匹配"));
        assert!(methods.contains_key("格式化"));
    }

    #[test]
    fn test_string_utils() {
        // 测试空白字符检查
        assert!(StringUtils::is_whitespace("   \t\n"));
        assert!(!StringUtils::is_whitespace("hello"));

        // 测试数字检查
        assert!(StringUtils::is_numeric("12345"));
        assert!(!StringUtils::is_numeric("123abc"));

        // 测试字母检查
        assert!(StringUtils::is_alphabetic("hello"));
        assert!(!StringUtils::is_alphabetic("hello123"));

        // 测试命名法转换
        assert_eq!(StringUtils::to_camel_case("hello world"), "helloWorld");
        assert_eq!(StringUtils::to_snake_case("hello world"), "hello_world");
        assert_eq!(StringUtils::to_kebab_case("hello world"), "hello-world");

        // 测试填充
        assert_eq!(StringUtils::pad_left("123", 5, '0'), "00123");
        assert_eq!(StringUtils::pad_right("123", 5, '0'), "12300");

        // 测试Unicode长度
        assert_eq!(StringUtils::unicode_length("你好"), 2);
        assert_eq!(StringUtils::unicode_length("hello"), 5);

        // 测试子字符串
        assert_eq!(StringUtils::substring("hello world", 6, 11), "world");

        // 测试反转
        assert_eq!(StringUtils::reverse("hello"), "olleh");

        // 测试回文
        assert!(StringUtils::is_palindrome("level", false));
        assert!(!StringUtils::is_palindrome("hello", false));
    }
}
